package login;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import struts.action.Action;
import struts.form.ActionForm;


public class LoginAction implements Action {

	public String execute(HttpServletRequest request,HttpServletResponse respone, ActionForm form,
			Map<String, String> forward) {
		LoginForm loginForm=(LoginForm)form;
		String url="failed";
		if(!"".equals(loginForm.getName()) && "test".equals(loginForm.getName()) && 
			!"".equals(loginForm.getPass()) && "123456".equals(loginForm.getPass())	){
			url="success";
		}
		return forward.get(url);
	}
}
